

export function filterData(arr,role){
    return arr.filter(item=>!item.roles || item.roles.includes(role)).map(item=>{
        const o = {
            ...item,
        }
        if(item.children){//如果有children,则对children做同样的处理
            o.children = filterData(item.children,role);
        }
        return o;
    })
}  